<template>
  <div class="site-topbar">
    <div class="topbarcontent">
      <div class="left">
        <a href="#">小米商城</a><span class="span">|</span> <a href="#">MIUI</a
        ><span class="span">|</span> <a href="#">loT</a
        ><span class="span">|</span> <a href="#">云服务</a
        ><span class="span">|</span> <a href="#">天星数科</a
        ><span class="span">|</span> <a href="#">有品</a
        ><span class="span">|</span> <a href="#">小爱开放平台</a
        ><span class="span">|</span> <a href="#">企业团购</a
        ><span class="span">|</span> <a href="#">资质证照</a
        ><span class="span">|</span> <a href="#">协议规则</a
        ><span class="span">|</span>
        <a href="#" class="downloadapp"
          >下载app<app-code class="appcode"></app-code></a
        ><span class="span">|</span> <a href="#"> 智能生活</a
        ><span class="span">|</span>
        <a href="#">Select Location</a>
      </div>
      <div class="right">
        <div class="login">
          <a href="#"> 登录 </a>
          <span class="span">|</span>
          <a href="#"> 注册 </a>
          <span class="span">|</span>
          <a href="#"> 消息通知 </a>
        </div>
        <topbar-cart class="topbarCart" />
      </div>
    </div>
  </div>
</template>

<script>
import AppCode from "./app-code.vue";
import TopbarCart from "./topbar-cart.vue";
export default {
  data() {
    return {};
  },
  components: {
    AppCode,
    TopbarCart,
  },
};
</script>
<style lang='less' scoped>
.site-topbar {
  width: 100%;
  height: 40px;
  background-color: #333;
  font: 12px/1.5 Helvetica Neue, Helvetica, Arial, Microsoft Yahei,
    Hiragino Sans GB, Heiti SC, WenQuanYi Micro Hei, sans-serif;
  .topbarcontent {
    min-width: 1226px;
    width: 1226px;
    height: 40px;
    margin: 0 auto;
    a {
      color: #b0b0b0;
      display: inline-block;
      height: 40px;
      line-height: 42px;
      color: #b0b0b0;
      &:hover {
        color: #fff;
      }
    }
    .left {
      display: inline-block;

      .downloadapp {
        position: relative;
        &:hover .appcode {
          display: block;
          overflow: hidden;
          height: 148px;
        }
        .appcode {
          z-index: 31;
          position: absolute;
          transition: all 0.2s;
          overflow: hidden;
          top: 40px;
          height: 0;
          transform: translateX(-25%);
        }
      }
    }
    .right {
      float: right;
      .login {
        float: left;
      }
      .topbarCart {
        z-index: 30;
        float: right;
        margin-left: 15px;
        width: 120px;
        height: 40px;
      }
    }
  }

  .span {
    margin: 0 7px;
    color: #424242;
  }
}
</style>